//数据库配置
const pg = require('pg');

const outer = {};



/**
 * ping数据库
 * @param {String} jdbcUrl 
 */
outer.ping = async(jdbcUrl) => {
    const client = new pg.Client(jdbcUrl);
    try {
        await client.connect();
        await client.end();
        return {success: true, msg: '连接postgresql成功'}
    } catch (error) {
        // console.log(error)
        return {success: false, msg: '连接postgresql出错'}
    }
}


module.exports  = outer;